import { requestClient,requestClientBody } from '#/api/request';

/**
 * 列表
 */
export async function getListApi(params: any) {
  let searchParams = new URLSearchParams(params);
  return requestClient.get('/help/lists?'+searchParams.toString());
}

/**
 * 获取分类树
 */
export async function getCategoryTreesApi() {
  return requestClient.get('/help/categorytrees');
}
  
/**
 * 新增
 */
export async function createApi(data: any) {
  return requestClientBody.post('/help/add', {form:data});
}

/**
 * 编辑
 */
export async function editApi(data: any) {
  return requestClientBody.post('/help/edit?id='+data.id, {form:data});
}

/**
 * 更新状态
 */
export async function setstatusApi(data: any) {
  return requestClientBody.post('/help/setstatus', data);
}

/**
 * 删除
 */
export async function deleteApi(id: number) {
  return requestClientBody.post('/help/delete?id='+id);
}

/**
 * 详情
 */
export async function detailApi(id: number) {
  return requestClient.get('/help/detail?id='+id);
}